//
//  StatusNormalCell.swift
//  新浪微博
//
//  Created by 焦林生 on 15/11/12.
//  Copyright © 2015年 焦林生. All rights reserved.
//

import UIKit
//原创微博cell
class StatusNormalCell: StatusCell {

    
    //微博视图模型
    override var viewModel: StatusViewModel? {
    
        didSet {
        
            //修改配图视图大小
            pictureView.snp_makeConstraints { (make) -> Void in
                
                //根据配图视图 设置配图视图顶部约束
                let offset = viewModel?.thumbnailUrls?.count > 0 ? StatusCellMargin : 0
                make.top.equalTo(contentLabel.snp_bottom).offset(offset)
                
            }
        }
    }
    
    override func setupUI() {
    
        super.setupUI()
        //3 配图视图
        pictureView.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(contentLabel.snp_bottom).offset(StatusCellMargin)
            make.left.equalTo(contentLabel.snp_left)
            make.width.equalTo(300)
            make.height.equalTo(90)
        }
    }

}



